<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/templates/common/taglib.jsp"%>

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Access-Control-Allow-Origin" content="*">
<title>${title}</title>
<%@include file="/WEB-INF/templates/common/common.jsp"%>
<script type="text/javascript" src="${basePath}/static/page/js/jqPaginator.js"></script>
<script type="text/javascript" src="${basePath}/static/My97DatePicker/WdatePicker.js"></script>
<script  type="text/javascript" src="${basePath}/static/js/util.js"></script>
<script  type="text/javascript" src="${basePath}/static/layer/layer.js"></script>
<link href="${basePath}/static/layer/layer_style.css" rel="stylesheet" type="text/css">
<script language="javascript" src="${basePath}/static/js/LodopFuncs.js"></script>
</head>
<body>
 <!--头部-->
 <%@include file="/WEB-INF/templates/common/header.jsp"%>

<!------导航条-->
 <%@include file="/WEB-INF/templates/common/navigation.jsp"%>

<div class="list_main lay_out">
 <div class="list_DH">
    <!--打印模块导航栏-->
 <%@include file="/WEB-INF/templates/common/printnav.jsp"%>
 </div>
 <div class="list_NR">
  <div class="loc">
   <h3>填写病案打印信息</h3>
  </div>
  <div class="list_con_table"> 
   <div class="search_table">
    <ul id="table_ul">
    <input type="hidden" value="${basePath}" id="basePath"/>
    <input type="hidden" value="${picHostPath}" id="picHostPath"/>
    <input type="hidden" value="${corePath}" id="corePath"/>
   <form id="form1"  method="post" action="${basePath}/print/printLittleScrip">
    <li class="Label_1" >年：&nbsp;</li>
    <li class="Label_2"><input class="input_box" type="text" name="year" /></li>
    <li class="Label_1" >月：&nbsp;</li>
    <li class="Label_2"><input class="input_box" type="text"  name="month" /></li>
   	<li class="Label_1">科室(1)：</li>
    <li class="Label_2">
    	<select class="input_box" name="deptCode1"></select> 
    	<input class="input_box" type="hidden" name="deptName1" maxlength="60"/>
     </li>
     
      <li class="Label_1" >科室(2)：</li>
    <li class="Label_2">
    	<select class="input_box" name="deptCode2"></select>
    	<input class="input_box" type="hidden" name="deptName2"/>
    </li>
    
    <li class="Label_1" >箱数：</li>
    <li class="Label_2"><input class="input_box" type="text" name="boxNumber1"/></li>
    
    
    <li class="Label_1" >箱号：</li>
    <li class="Label_2"><input type="text" id="printCopies" class="input_box" name="boxNumber2"/></li>
					
 
    <li class="Label_5">
	   <a onclick="prn1_preview()" style="width:auto;">提交打印信息</a>
    </li>
    </form>
    </ul>
  </div>
 </div>
</div>
</div> 



</div>
</div>
<!--页脚部分-->
<%@include file="/WEB-INF/templates/common/footer.jsp"%>
<script language="javascript" type="text/javascript">   
	$(function(){
		$("select").each(function(){
			$(this).append("<option value=''>---请选择---</option>");
		});

	
		var corePath = $("#corePath").val();
		$.ajax({
		url: corePath + "/baseinfo/ajax_medical_offices",
		type: "GET",
		data:{hospitalId:1},
		dataType: "json",
		success: function( datas ) {
			var medicalDepts = datas['medicalOfficesList'];
			$("select[name='deptCode1'],[name='deptCode2']").each(function(){
				var options = "";
				for(var index in medicalDepts){
					var medicalDept = medicalDepts[index];
			    	options+="<option value='"+medicalDept.code+"'>"+medicalDept.name+"</option>"
			    } 
		       $(this).append(options);
		       $(this).change(function(){
		       		var eventObj = $(this);
			   		var nameObjName = eventObj.attr("name").replace("Code", "Name");
			   		
			   		if(eventObj.val()!=""){
			   			var name=eventObj.find("option:selected").text();
			   			eventObj.next("input[name='"+nameObjName+"']").val(name);
			   		}else{
			   			eventObj.next("input[name='"+nameObjName+"']").val("");
			   		}
		       });
		       
			});
		}
	});
		
	});
	function prn1_preview() {	
		$("#form1").submit();
	};
	
</script> 
</body>
</html>
